Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more Parallel InSty fixes #2017

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

jamesmkrieger
Copy link
Contributor

No description provided.

Copy link
Contributor

@karolamik13 karolamik13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine.

PDB ensemble:
In [1]: from prody import *
In [2]: atoms2 = parsePDB('2k39')
In [3]: interactionsTrajectory = InteractionsTrajectory('trajectory')
In [4]: interactionsTrajectory.calcProteinInteractionsTrajectory(atoms2, stop_frame=5)
Out[4]:
[[43, 52, 53, 50, 49, 50],
[3, 6, 2, 4, 5, 6],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[16, 19, 16, 18, 20, 17],
[0, 0, 0, 0, 0, 0]]

In [5]: interactionsTrajectory.calcProteinInteractionsTrajectory(atoms2, stop_frame=5)
Out[5]:
[[43, 52, 53, 50, 49, 50],
[3, 6, 2, 4, 5, 6],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[16, 19, 16, 18, 20, 17],
[0, 0, 0, 0, 0, 0]]

In [6]: interactionsTrajectory.calcProteinInteractionsTrajectory(atoms2, stop_frame=5)
Out[6]:
[[43, 52, 53, 50, 49, 50],
[3, 6, 2, 4, 5, 6],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0],
[16, 19, 16, 18, 20, 17],
[0, 0, 0, 0, 0, 0]]

In [7]: interactionsTrajectory.getInteractions()
Out[7]:
[[[['GLN49', 'NE2_784', 'A', 'GLU51', 'OE2_820', 'A', 2.5853, 16.2407],
['LYS11', 'NZ_175', 'A', 'GLU34', 'OE1_547', 'A', 2.6141, 7.0039],
['GLY10', 'N_160', 'A', 'THR7', 'O_116', 'A', 2.6801, 19.8254],
['ARG72', 'N_1149', 'A', 'GLN40', 'O_624', 'A', 2.6883, 21.0779],
['ARG72', 'NH1_1158', 'A', 'GLN40', 'OE1_628', 'A', 2.7336, 7.4598],
..

I also tested calcXX, where XX is the interaction type.

In [10]: rib = calcRepulsiveIonicBondingTrajectory(atoms2)

In [11]: rib
Out[11]:
[[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[],
[['ARG72', 'NH1_1158_1159', 'A', 'ARG74', 'NH1_1201_1202', 'A', 4.1822]],
[],
[['ASP52', 'OD1_833_834', 'A', 'GLU24', 'OE1_378_379', 'A', 4.0632]],
[],
[],
[],
..
..

Trajectory:
In [16]: PDBfile = "5kqm_all_sci.pdb"
...: Trajectoryfile = 'NAMD_D2.dcd'
...: atoms = parsePDB(PDBfile)
...: dcd = Trajectory(Trajectoryfile)
...:
...: dcd.link(atoms)
...: dcd.setCoords(atoms)

In [17]: interactionsTrajectory2 = InteractionsTrajectory('trajectory2')
In [18]: interactionsTrajectory2.calcProteinInteractionsTrajectory(atoms, dcd, start_frame=5, stop_frame=10)
Out[18]:
[[119, 123, 125, 125, 120, 126],
[15, 16, 15, 16, 15, 14],
[0, 0, 0, 0, 0, 0],
[1, 3, 3, 2, 3, 3],
[3, 2, 4, 3, 3, 3],
[34, 37, 36, 36, 33, 33],
[0, 0, 0, 0, 0, 0]]

@jamesmkrieger
Copy link
Contributor Author

I think we were getting the wrong number of frames being read and maybe this is now fixed

@karolamik13
Copy link
Contributor

start_frame=5, stop_frame=10 -> As a result, we have 6 computed frames because we are counting in the 5th, 6th, 7th, 8th, 9th, and 10th frames. I mentioned about it last week. That it might be confusing.

@jamesmkrieger
Copy link
Contributor Author

I think it makes sense. We start with and include frame 5 and continue until we have included frame 10 and then stop. So, yes, we get frames 5, 6, 7, 8, 9 and 10. These are actually the 6th, 7th, 8th, 9th, 10th and 11th frames because python starts at 0.

@jamesmkrieger
Copy link
Contributor Author

Your results from the last tests are actually not doing that. For example, the last one has 7 frames

1 [[119, 123, 125, 125, 120, 126],
2 [15, 16, 15, 16, 15, 14],
3 [0, 0, 0, 0, 0, 0],
4 [1, 3, 3, 2, 3, 3],
5 [3, 2, 4, 3, 3, 3],
6 [34, 37, 36, 36, 33, 33],
7 [0, 0, 0, 0, 0, 0]]

@karolamik13
Copy link
Contributor

Your results from the last tests are actually not doing that. For example, the last one has 7 frames

1 [[119, 123, 125, 125, 120, 126], 2 [15, 16, 15, 16, 15, 14], 3 [0, 0, 0, 0, 0, 0], 4 [1, 3, 3, 2, 3, 3], 5 [3, 2, 4, 3, 3, 3], 6 [34, 37, 36, 36, 33, 33], 7 [0, 0, 0, 0, 0, 0]]

Frame 5 6 7 8 9 10
HBs [[119, 123, 125, 125, 120, 126],
SBs [15, 16, 15, 16, 15, 14],
RIB [0, 0, 0, 0, 0, 0],
PiCat [1, 3, 3, 2, 3, 3],
PiStack [3, 2, 4, 3, 3, 3],
HPh [34, 37, 36, 36, 33, 33],
Disu [0, 0, 0, 0, 0, 0]]

@jamesmkrieger
Copy link
Contributor Author

oh, yeah. I forgot it worked like that. Sorry

@karolamik13
Copy link
Contributor

Yes, it might be confusing, but it is easier to extract things.

@jamesmkrieger
Copy link
Contributor Author

That wasn't the part that needed checking now. I've now been fixing the single interactions cases

@jamesmkrieger
Copy link
Contributor Author

For example, this one:

In [1]: from prody.tests.proteins.test_insty import TestInteractions

In [2]: from prody import *

In [3]: self = TestInteractions()

In [4]: self.setUp()
@> 1231 atoms and 15 coordinate set(s) were parsed in 0.03s.
@> 1231 atoms and 1 coordinate set(s) were parsed in 0.01s.
@> 12793 atoms and 1 coordinate set(s) were parsed in 0.09s.

In [5]: self.data_sbs = calcSaltBridgesTrajectory(self.ATOMS, stop_frame=13)
@> Model: 0
@> Model: 1
@> Model: 2
@> Model: 3
@> Model: 4
@> Model: 5
@> Calculating salt bridges.
@> Calculating salt bridges.
@> Calculating salt bridges.
@> Calculating salt bridges.
@>      LYS27    A          NZ_424  <--->      ASP52    A     OD1_833_834     2.9
@>      LYS11    A          NZ_175  <--->      GLU34    A     OE1_547_548     3.2
@>      LYS33    A          NZ_526  <--->      ASP32    A     OD1_512_513     3.4
@>      GLU51    A     OE1_819_820  <--->      ARG54    A     NH1_855_856     4.1
@>      LYS29    A          NZ_456  <--->      ASP21    A     OD1_332_333     4.9
@> Number of detected salt bridges: 5.
@> Calculating salt bridges.
@>      LYS33    A          NZ_526  <--->      GLU16    A     OE1_262_263     2.7
@>      GLU64    A   OE1_1026_1027  <--->      LYS63    A         NZ_1005     2.9
@>      ARG72    A   NH1_1158_1159  <--->      ASP39    A     OD1_615_616     3.3
@>      LYS29    A          NZ_456  <--->      ASP21    A     OD1_332_333     4.2
@>      LYS29    A          NZ_456  <--->      GLU16    A     OE1_262_263     4.8
@> Number of detected salt bridges: 5.
@>      LYS27    A          NZ_424  <--->      GLU24    A     OE1_378_379     3.0
@>      LYS29    A          NZ_456  <--->      ASP21    A     OD1_332_333     3.1
@>      LYS11    A          NZ_175  <--->      GLU34    A     OE1_547_548     3.1
@>      LYS33    A          NZ_526  <--->      ASP32    A     OD1_512_513     3.4
@>      GLU64    A   OE1_1026_1027  <--->      LYS63    A         NZ_1005     3.5
@>      ARG74    A   NH1_1201_1202  <--->      ASP39    A     OD1_615_616     3.7
@>      ARG72    A   NH1_1158_1159  <--->      ASP39    A     OD1_615_616     4.7
@> Number of detected salt bridges: 7.
@> Calculating salt bridges.
@>      GLU64    A   OE1_1026_1027  <--->      LYS63    A         NZ_1005     2.9
@>      LYS27    A          NZ_424  <--->      ASP52    A     OD1_833_834     3.8
@>      GLU51    A     OE1_819_820  <--->      ARG54    A     NH1_855_856     4.0
@>      LYS29    A          NZ_456  <--->      ASP21    A     OD1_332_333     4.7
@> Number of detected salt bridges: 4.
@>      LYS11    A          NZ_175  <--->      GLU34    A     OE1_547_548     2.5
@>      ARG72    A   NH1_1158_1159  <--->      ASP39    A     OD1_615_616     2.5
@>      LYS27    A          NZ_424  <--->      ASP52    A     OD1_833_834     2.7
@>      GLU64    A   OE1_1026_1027  <--->      LYS63    A         NZ_1005     2.9
@>      LYS33    A          NZ_526  <--->      ASP32    A     OD1_512_513     3.7
@>      LYS29    A          NZ_456  <--->      ASP21    A     OD1_332_333     4.2
@> Number of detected salt bridges: 6.
@>      LYS27    A          NZ_424  <--->      ASP52    A     OD1_833_834     3.0
@>      LYS29    A          NZ_456  <--->      ASP21    A     OD1_332_333     3.1
@>      GLU51    A     OE1_819_820  <--->      ARG54    A     NH1_855_856     3.9
@> Number of detected salt bridges: 3.
@> Model: 6
@> Model: 7
@> Model: 8
@> Model: 9
@> Model: 10
@> Model: 11
@> Calculating salt bridges.
@> Calculating salt bridges.
@> Calculating salt bridges.
@> Calculating salt bridges.
@> Calculating salt bridges.
@>      LYS11    A          NZ_175  <--->      GLU34    A     OE1_547_548     2.8
@>      LYS29    A          NZ_456  <--->      ASP21    A     OD1_332_333     2.9
@>      GLU51    A     OE1_819_820  <--->      ARG54    A     NH1_855_856     4.0
@> Number of detected salt bridges: 3.
@>      LYS33    A          NZ_526  <--->      GLU16    A     OE1_262_263     2.7
@>      LYS27    A          NZ_424  <--->      ASP52    A     OD1_833_834     2.8
@>      LYS11    A          NZ_175  <--->      GLU34    A     OE1_547_548     3.0
@>      LYS29    A          NZ_456  <--->      GLU16    A     OE1_262_263     3.6
@> Number of detected salt bridges: 4.
@>      LYS27    A          NZ_424  <--->      ASP52    A     OD1_833_834     2.5
@>      LYS11    A          NZ_175  <--->      GLU34    A     OE1_547_548     3.3
@>      LYS29    A          NZ_456  <--->      ASP21    A     OD1_332_333     3.4
@>      LYS33    A          NZ_526  <--->      ASP32    A     OD1_512_513     3.5
@>      ASP58    A     OD1_920_921  <--->      ARG54    A     NH1_855_856     4.8
@> Number of detected salt bridges: 5.
@>      LYS11    A          NZ_175  <--->      GLU34    A     OE1_547_548     2.5
@>      LYS29    A          NZ_456  <--->      ASP21    A     OD1_332_333     2.7
@>      LYS27    A          NZ_424  <--->      ASP52    A     OD1_833_834     3.0
@>      LYS33    A          NZ_526  <--->      ASP32    A     OD1_512_513     3.5
@>      ASP58    A     OD1_920_921  <--->      ARG54    A     NH1_855_856     4.1
@>      ARG72    A   NH1_1158_1159  <--->      ASP39    A     OD1_615_616     4.2
@>      GLU51    A     OE1_819_820  <--->      ARG54    A     NH1_855_856     4.8
@> Number of detected salt bridges: 7.
@>      LYS11    A          NZ_175  <--->      GLU34    A     OE1_547_548     3.0
@>      LYS29    A          NZ_456  <--->      ASP21    A     OD1_332_333     4.9
@> Number of detected salt bridges: 2.
@> Calculating salt bridges.
@>      GLU64    A   OE1_1026_1027  <--->      LYS63    A         NZ_1005     2.6
@>      LYS11    A          NZ_175  <--->      GLU34    A     OE1_547_548     2.8
@>      GLU51    A     OE1_819_820  <--->      ARG54    A     NH1_855_856     5.0
@> Number of detected salt bridges: 3.
@> Model: 12
@> Calculating salt bridges.
@>      LYS27    A          NZ_424  <--->      ASP52    A     OD1_833_834     3.2
@>      ASP58    A     OD1_920_921  <--->      ARG54    A     NH1_855_856     3.9
@>      LYS11    A          NZ_175  <--->      GLU34    A     OE1_547_548     4.2
@>      GLU51    A     OE1_819_820  <--->      ARG54    A     NH1_855_856     4.8
@> Number of detected salt bridges: 4.
@> Model: 13
@> Calculating salt bridges.
@>      LYS27    A          NZ_424  <--->      ASP52    A     OD1_833_834     2.6
@>      LYS11    A          NZ_175  <--->      GLU34    A     OE1_547_548     2.6
@>      GLU64    A   OE1_1026_1027  <--->      LYS63    A         NZ_1005     3.2
@>      LYS33    A          NZ_526  <--->      ASP32    A     OD1_512_513     3.5
@>      GLU51    A     OE1_819_820  <--->      ARG54    A     NH1_855_856     4.3
@> Number of detected salt bridges: 5.

In [6]: [len(x) for x in self.SBS_INTERACTIONS]
Out[6]: [7, 5, 5, 4, 3, 6, 3, 4, 2, 7, 5, 3, 4, 5]

In [7]: [len(x) for x in self.data_sbs]
Out[7]: [5, 5, 7, 4, 6, 3, 3, 4, 5, 7, 2, 3, 4, 5]

@jamesmkrieger
Copy link
Contributor Author

Oh, I have a fix for this problem that’s making the tests fail now. I just need to commit and push it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants